import operate from '../common/operate.js'
 
 
export default{
    getPreOrderListByPage : function(param) {
        // 请求参数
        var url = param.url,
            header = {},
            data = param.data,
			url = "/purchase/preOrder/listByPage", 
			method = "POST";
		var requestUrl = operate.api + url;
		if (method) {
			method = method.toUpperCase(); 
			if (method == "POST") {
				header = {
				   'content-type': "application/json"
				};
			} else {
				header = {
					'content-type': "application/json"
				};
			}
		}
		 uni.request({
			url: requestUrl,		
			data: param,
			method: method,
			header: header,
			success: (res) => {
				return res;
			},fail(res2) {
				return res2;
			}
		})
 
	},
	getPreOrderDetail : function(param) {
	    // 请求参数
	    var url = param.url,
	        header = {},
	        data = param.data,
			url = "/purchase/preOrder/detail", 
			method = "POST";
		var requestUrl = operate.api + url;
		if (method) {
			method = method.toUpperCase(); 
			if (method == "POST") {
				header = {
				   'content-type': "application/json"
				};
			} else {
				header = {
					'content-type': "application/json"
				};
			}
		}
		 uni.request({
			url: requestUrl,		
			data: param,
			method: method,
			header: header,
			success: (res) => {
				return res;
			},fail(res2) {
				return res2;
			}
		})
	 
	},
	getPreOrderNotice : function(param) {
	    // 请求参数
	    var url = param.url,
	        header = {},
	        data = param.data,
			url = "/purchase/preOrder/notice", 
			method = "POST";
		var requestUrl = operate.api + url;
		if (method) {
			method = method.toUpperCase(); 
			if (method == "POST") {
				header = {
				   'content-type': "application/json"
				};
			} else {
				header = {
					'content-type': "application/json"
				};
			}
		}
		 uni.request({
			url: requestUrl,		
			data: param,
			method: method,
			header: header,
			success: (res) => {
				return res;
			},fail(res2) {
				return res2;
			}
		})
	 
	}
}